
// Defines available actions. Each action is a function
// returning its argument decorated with the action name.
// For example, Action.buy(o) returns o after setting
// o.action = 'buy'.
Action = {
    buy: null,
    meet: null
};

// Configures each action function.
(function() {
    var actionFunction = function(name) {
        return function(a) {
            a.action = name;
            return a;
        };
    };

    for (var name in Action) {
        if (Action.hasOwnProperty(name)) {
            Action[name] = actionFunction(name);
        }
    }
})();
